<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<body>
	<ui:composition template="/template/template.xhtml">
		<ui:define name="title">#{aqarMsgs.Aqarat_Apartments_SaleApartment_PageTitle}</ui:define>
		<ui:define name="manuBar">
			<ui:include src="/controlling/aqarat/aqaratMenu.xhtml" />
		</ui:define>

		<ui:define name="content">
			<h:form id="saleApartment_frm">
				<p:panel header="#{aqarMsgs.Aqarat_Apartments_SaleApartment_SaleApartment}">
					<p:panel>

						<h:panelGrid columns="2">
							<h:outputText value="#{aqarMsgs.Aqarat_Customer_ChooseCustomer}" />
							<p:autoComplete value="#{saleApartmentBean.apartment.customerId}"
								completeMethod="#{saleApartmentBean.searchCustomer}" var="cust"
								itemLabel="#{cust.name}" itemValue="#{cust.recid}"
								forceSelection="true">

								<f:facet name="itemtip">
									<h:panelGrid columns="3" cellpadding="5">

										<h:outputText value="#{aqarMsgs.Aqarat_Customer_Name}" />
										<h:outputText value=":" />
										<h:outputText value="#{cust.name}" />

										<h:outputText value="#{aqarMsgs.Aqarat_Customer_Mobile}" />
										<h:outputText value=":" />
										<h:outputText value="#{cust.mobile}" />

										<h:outputText value="#{aqarMsgs.Aqarat_Customer_CardNo}" />
										<h:outputText value=":" />
										<h:outputText value="#{cust.cardNo}" />
									</h:panelGrid>
								</f:facet>

							</p:autoComplete>
							<h:outputText value="#{aqarMsgs.Aqarat_Apartments_SalePrice}" />
							<p:inputText value="#{saleApartmentBean.apartment.salePrice}"
								required="true" requiredMessage="#{aqarMsgs.Aqarat_Apartmentss_SalePriceRequired}"
								converterMessage="#{aqarMsgs.Aqarat_Apartmentss_SalePriceConverter}">
								<f:converter converterId="javax.faces.Number" />
							</p:inputText>

							<h:outputText value="#{aqarMsgs.Aqarat_Apartments_FirstPayment}" />
							<p:inputText value="#{saleApartmentBean.apartment.firstPayment}"
								required="true"
								requiredMessage="#{aqarMsgs.Aqarat_Apartments_FirstPaymentRequired}"
								converterMessage="#{aqarMsgs.Aqarat_Apartments_FirstPaymentConverter}">
								<f:converter converterId="javax.faces.Number" />
							</p:inputText>

							<h:outputText value="#{aqarMsgs.Aqarat_Apartments_NoOfPayments}" />
							<p:inputText value="#{saleApartmentBean.apartment.noOfPayments}"
								required="true"
								requiredMessage="#{aqarMsgs.Aqarat_Apartments_NoOfPaymentsRequired}"
								converterMessage="#{aqarMsgs.Aqarat_Apartments_NoOfPaymentsConverter}">
								<f:converter converterId="javax.faces.Long" />
							</p:inputText>
						</h:panelGrid>

						<p:commandButton value="#{aqarMsgs.Aqarat_Apartments_Apartments_Sale}"
							actionListener="#{saleApartmentBean.saleApartment}"
							onstart="waiteDialog.show();" oncomplete="waiteDialog.hide();"
							update="msgs" />
						<p:commandButton value="Show Calculator"
							onclick="calculateDlg.show();" />
					</p:panel>
					<p:panel>
						<h:panelGrid columns="3">
							<h:outputText value="#{aqarMsgs.Aqarat_Apartments_No}" />
							<h:outputText value=":" />
							<h:outputText value="#{saleApartmentBean.apartment.no}" />

							<h:outputText value="#{aqarMsgs.Aqarat_Apartments_Area}" />
							<h:outputText value=":" />
							<h:outputText value="#{saleApartmentBean.apartment.area}" />

							<h:outputText value="#{aqarMsgs.Aqarat_Apartments_Price}" />
							<h:outputText value=":" />
							<h:outputText value="#{saleApartmentBean.apartment.salePrice}" />

							<h:outputText value="#{aqarMsgs.Aqarat_Apartments_ConstructStatus}" />
							<h:outputText value=":" />
							<h:outputText
								value="#{saleApartmentBean.apartment.constructtStatus.name}" />

							<h:outputText value="#{aqarMsgs.Aqarat_Apartments_TaxesStatus}" />
							<h:outputText value=":" />
							<h:outputText
								value="#{saleApartmentBean.apartment.taxessStatus.name}" />
						</h:panelGrid>
					</p:panel>

					<p:messages id="msgs" />
				</p:panel>
			</h:form>

			<p:dialog widgetVar="calculateDlg">
				<ui:include src="calculatePayments.xhtml" />
			</p:dialog>
		</ui:define>
	</ui:composition>
</body>
</html>
